//-------------------------------------------------------------------
//	Copyright (c) 2012-2014 Zhirnov Andrey
//	This file is part of the "UXGEN-ES" project.
//	See copyright notice in "Engine.h".
//-------------------------------------------------------------------

#pragma once

#include "Graphics/GLshell/StateManager.h"

namespace Engine
{
namespace Graphics
{

	//
	// State Keeper
	//

	struct GLStateKeeper
	{
		struct FrameBuffer
		{
			const EngineSubSystemsRef	_ess;
			const gles::GLuint			_fbo;
			///
			FrameBuffer (const EngineSubSystemsRef ess) :
				_ess(ess), _fbo( ess->GetGLStateManager()->GetFrameBuffer() )
			{}

			~FrameBuffer () {
				_ess->GetGLStateManager()->BindFrameBuffer( _fbo );
			}
		};

		// TODO: program, ...
	};


}	// Graphics
}	// Engine